
module.exports = {
    initItem: function (t) {
        var e = cc.sys.localStorage.getItem(t.str);
        null != e && 0 != e.length || cc.sys.localStorage.setItem(t.str, t.number);
    },
    init: function () {
        console.log("初始化本地数据")
        , this.initItem({
            str: "data",
            number: 0
        }), this.initItem({
            str: "dataTime",
            number: 0
        }), this.initItem({
            str: "gamecount",
            number: 0
        }), this.initItem({
            str: "score",
            number: 0
        }), this.initItem({
            str: "gold",
            number: 50
        }), this.initItem({
            str: "maxscore",
            number: 0
        }), this.initItem({
            str: "level",
            number: 1
        }), this.initItem({
            str: "groupData",
            number: "{}"
        }), this.initItem({
            str: "tool1num",
            number: "0"
        }), this.initItem({
            str: "tool2num",
            number: "0"
        }), this.initItem({
            str: "tool3num",
            number: "0"
        }), this.initItem({
            str: "reviveTime",
            number: "2"
        });
    },
    get: function (t) {
        return parseInt(cc.sys.localStorage.getItem(t));
    },
    set: function (t, e) {
        cc.sys.localStorage.setItem(t, e);
    },
    setData: function (t) {
        cc.sys.localStorage.setItem("data", t);
    },
    getData: function () {
        return cc.sys.localStorage.getItem("data");
    },
    setGroupData: function (t) {
        cc.sys.localStorage.setItem("groupData", t);
    },
    getGroupData: function () {
        return cc.sys.localStorage.getItem("groupData");
    },
    getBoolean: function (t) {
        return cc.sys.localStorage.getItem(t);
    }
}